/*
 * @Description:: 请补充填写
 * @Version: 请配置版本号
 * @Author: xiaobai
 * @Date: 2020-08-30 07:59:10
 * @LastEditors: xiaobai
 * @LastEditTime: 2021-09-21 19:55:20
 * @FilePath: /vue-admin-template-master/src/store/modules/user.js
 */

const getDefaultState = () => {
  return {
    token: window.localStorage.getItem('token')
  }
}

const state = getDefaultState()

const mutations = {
  RESET_STATE: (state) => {
    Object.assign(state, getDefaultState())
  },
  SET_TOKEN: (state, token) => {
    state.token = token
  },
  SET_NAME: (state, name) => {
    state.name = name
  },
  SET_AVATAR: (state, avatar) => {
    state.avatar = avatar
  }
}

const actions = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

